package health.lm.com.find.adapter;

import android.support.annotation.Nullable;

import com.blankj.utilcode.util.StringUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import health.lm.com.component_base.helper.ImageLoaderHelper;
import health.lm.com.find.R;
import health.lm.com.find.entity.MemberAffiliateItemEntity;

/**
 * 会员联盟商
 * @author Administrator
 */

public class MemberAffiliateItemAdapter extends BaseQuickAdapter<MemberAffiliateItemEntity.Lists,BaseViewHolder> {
    public MemberAffiliateItemAdapter(@Nullable List<MemberAffiliateItemEntity.Lists> data) {
        super(R.layout.item_member_affiliate, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MemberAffiliateItemEntity.Lists item) {
        helper.setText(R.id.tv_content_title,item.getTitle())
                .setText(R.id.tv_mobile,String.format("电话：%s",item.getTel()))
                .setText(R.id.tv_adr,String.format("地址：%s",item.getAddress()));
        if (StringUtils.isEmpty(item.getThumb())){
            ImageLoaderHelper.getInstance().load(mContext,R.drawable.activity_image_store_def,helper.getView(R.id.iv_content_pic));
        }else {
            ImageLoaderHelper.getInstance().load(mContext,item.getThumb(),helper.getView(R.id.iv_content_pic));
        }
    }
}
